// NOTE: Exceptions.h included in Common.h
#include <Kharlia/Engine/Common.h>
#include <Kharlia/Engine/Init.h>

#include <CEGUIExceptions.h>

namespace kharlia { namespace engine {

static void Translate_CEGUI_Exception(ui::Exception const& e) {
    boost::format f("native UI::Exception(%2%): %1%");
    f % e.getMessage().c_str();
    f % e.getName().c_str();
    PyErr_SetString(PyExc_RuntimeError, f.str().c_str());
}

void _InitExceptions() {
    register_exception_translator<ui::Exception>(&Translate_CEGUI_Exception);
}

}}